// import './assets/main.css'

import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
//引入stores暴露出的pinia的实例
import {createPinia}  from 'pinia';
//配置持久化
import piniaPluginPersistedstate  from 'pinia-plugin-persistedstate'

// 引入插件
import router from "@/router/index";

import * as ElementPlusIconsVue from '@element-plus/icons-vue'


import zhCn from 'element-plus/es/locale/lang/zh-cn'
import './permission' // permission control



const pinia = createPinia();
pinia.use(piniaPluginPersistedstate)
const app = createApp(App);

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
// app.use(ElementPlus);
app.use(pinia)
app.use(ElementPlus, {
    locale: zhCn,
})
// 安装router插件
app.use(router)
app.mount('#app');